
/* Basics ______________________________________________________________________

	Paper:
	
	A Radio Drama’s Effects on Attitudes Toward Early and 
	Forced Marriage: Results from a Field Experiment in Rural Tanzania
	
	Replication: Main Text Tables
	
	Author: dylan groves, dylanwgroves@gmail.com
	Date: 2022/08/04
________________________________________________________________________________*/


/* Introduction ________________________________________________________________*/
	
	clear all		
	clear matrix
	clear mata
	set more off
	global c_date = c(current_date)
	version 16
	
	global cps_efm_path "~/Dropbox/Wellspring Tanzania Papers/Wellspring Tanzania - Audio Screening (efm)/cps_replication"
	
	*log using "~/Dropbox/Wellspring Tanzania Papers/Wellspring Tanzania - Audio Screening (efm)/cps_replication/cps_replication_log_maintext_ctlmeansd", replace
	
/* Define Parameters ___________________________________________________________

	You must run this to set globals before running any regressions

*/

	#d ;
		
		/* set seed */
		set seed 			1956
							;
							
		/* rerandomization count */
		global rerandcount	10000
							;
							
							
		global cov_always	i.block_as											// Covariates that are always included
							i.rd_group
							;
							
		global cov_lasso	std_resp_female 										// Covariates that are used by LASSO
							std_resp_muslim						
							std_resp_age
							std_b_resp_samevillage
							std_b_resp_religiosity
							std_b_resp_literate 	
							std_b_resp_standard7 
							std_b_resp_nevervisitcity 
							std_b_resp_married 
							std_b_resp_hhh 
							std_b_resp_numkid
							std_b_resp_numhh
							std_b_resp_yrsvill
							std_b_values_likechange 
							std_b_values_techgood 
							std_b_values_respectauthority 
							std_b_values_trustelders
							std_b_ge_raisekids 
							std_b_ge_earning 
							std_b_ge_leadership 
							std_b_ge_noprefboy 
							std_b_fm_reject
							std_b_media_tv_any 
							std_b_media_news_never 
							std_b_media_news_daily 
							std_b_radio_any 
							std_b_radio_community_ever
							std_b_radio_call_ever
							std_b_radio_stations_tbc 
							std_b_radio_stations_pfm 
							std_b_radio_stations_voa 
							std_b_radio_stations_clouds
							std_b_asset_multiplehuts
							std_b_asset_rooms
							std_b_asset_mudwalls
							std_b_asset_radio
							std_b_asset_tv
							std_b_asset_cell
							std_b_asset_cellint
							std_b_asset_worseconditions
							std_b_hiv_exctot
							std_b_hiv_safe
							;
		
		
	#d cr

	
/* Statistics from Main Text ___________________________________________________*/

* Proportion who know topic
	use "${cps_efm_path}/cps_efm_analysis.dta", clear
	keep if complier == 1
	replace m_comply_topic = 0 if m_comply_topic == .d | m_comply_topic == .o
	tab m_comply_topic if treat == 1
	tab m_comply_topic if treat == 0
	
	
* Effect of self / partner merge 
	use "${cps_efm_path}/cps_efm_analysis.dta", clear
	merge 1:1 id_resp_uid using "${cps_efm_path}/cps_efm_ri.dta"
	keep if complier == 1 
	
	replace fm_reject_long = fm_reject_long/3
	egen fm_reject_selfANDpartner = rowmean(fm_reject_long p_fm_partner_reject)
	global dv fm_reject_selfANDpartner 
	global test onesided 
				
			set seed 1956
			qui lasso linear $dv ${cov_lasso}										// This is the LASSO regression
				global lasso_ctls = e(allvars_sel)										
				global lasso_ctls_num = e(k_nonzero_sel)

			if ${lasso_ctls_num} != 0 {												// If lassovars selected	
				regress $dv treat ${cov_always} ${lasso_ctls}, cluster(id_village_n)
					matrix lasso_table = r(table)
				}
				
			if ${lasso_ctls_num} == 0 {												// If no lassovars selected
				regress $dv treat ${cov_always}, cluster(id_village_n)
					matrix lasso_table = r(table)
				}	
				
			global lasso_coef = lasso_table[1,1]    	//beta
			do "${cps_efm_path}/cps_efm_helper_pval_ri_lasso.do"
			di "${lasso_ripval2}"
	

/* Table 1 _____________________________________________________________________

Opposition to Early Forced Marriage, by Experimental Condition

*/

	use "${cps_efm_path}/cps_efm_analysis.dta", clear
	keep if treat == 0 

	sum m_efm_reject_story if age == 15 & scenario == 0 & amt == 5
	sum m_efm_reject_story if age == 15 & scenario == 0 & amt == 9
	sum m_efm_reject_story if age == 15 & scenario == 0 & amt == 10
	sum m_efm_reject_story if age == 15 & scenario == 0 

	sum m_efm_reject_story if age == 16 & scenario == 0 & amt == 5
	sum m_efm_reject_story if age == 16 & scenario == 0 & amt == 9
	sum m_efm_reject_story if age == 16 & scenario == 0 & amt == 10
	sum m_efm_reject_story if age == 16 & scenario == 0 

	sum m_efm_reject_story if age == 18 & scenario == 0 & amt == 5
	sum m_efm_reject_story if age == 18 & scenario == 0 & amt == 9
	sum m_efm_reject_story if age == 18 & scenario == 0 & amt == 10
	sum m_efm_reject_story if age == 18 & scenario == 0 
	
	sum m_efm_reject_story if age == 15 & scenario == 1 & amt == 5
	sum m_efm_reject_story if age == 15 & scenario == 1 & amt == 9
	sum m_efm_reject_story if age == 15 & scenario == 1 & amt == 10
	sum m_efm_reject_story if age == 15 & scenario == 1 

	sum m_efm_reject_story if age == 16 & scenario == 1 & amt == 5
	sum m_efm_reject_story if age == 16 & scenario == 1 & amt == 9
	sum m_efm_reject_story if age == 16 & scenario == 1 & amt == 10
	sum m_efm_reject_story if age == 16 & scenario == 1 

	sum m_efm_reject_story if age == 18 & scenario == 1 & amt == 5
	sum m_efm_reject_story if age == 18 & scenario == 1 & amt == 9
	sum m_efm_reject_story if age == 18 & scenario == 1 & amt == 10
	sum m_efm_reject_story if age == 18 & scenario == 1 
	
	sum m_efm_reject_story if age == 15 
	sum m_efm_reject_story if age == 16 
	sum m_efm_reject_story if age == 18 
	
	sum m_efm_reject_story if amt == 5 & scenario == 0 
	sum m_efm_reject_story if amt == 9 & scenario == 0
	sum m_efm_reject_story if amt == 10 & scenario == 0
	sum m_efm_reject_story if scenario == 0


	sum m_efm_reject_story if amt == 5 & scenario == 1 
	sum m_efm_reject_story if amt == 9 & scenario == 1
	sum m_efm_reject_story if amt == 10 & scenario == 1
	sum m_efm_reject_story if scenario == 1	
	
	sum m_efm_reject_story
	
/* Table 2 _____________________________________________________________________

Perceived Community Opposition to Early Forced Marriage, by Experimental Condition

*/

	use "${cps_efm_path}/cps_efm_analysis.dta", clear
	keep if treat == 0 

	sum m_efm_norm_story if age == 15 & scenario == 0 & amt == 5
	sum m_efm_norm_story if age == 15 & scenario == 0 & amt == 9
	sum m_efm_norm_story if age == 15 & scenario == 0 & amt == 10
	sum m_efm_norm_story if age == 15 & scenario == 0 

	sum m_efm_norm_story if age == 16 & scenario == 0 & amt == 5
	sum m_efm_norm_story if age == 16 & scenario == 0 & amt == 9
	sum m_efm_norm_story if age == 16 & scenario == 0 & amt == 10
	sum m_efm_norm_story if age == 16 & scenario == 0 

	sum m_efm_norm_story if age == 18 & scenario == 0 & amt == 5
	sum m_efm_norm_story if age == 18 & scenario == 0 & amt == 9
	sum m_efm_norm_story if age == 18 & scenario == 0 & amt == 10
	sum m_efm_norm_story if age == 18 & scenario == 0 
	
	
	sum m_efm_norm_story if age == 15 & scenario == 1 & amt == 5
	sum m_efm_norm_story if age == 15 & scenario == 1 & amt == 9
	sum m_efm_norm_story if age == 15 & scenario == 1 & amt == 10
	sum m_efm_norm_story if age == 15 & scenario == 1 

	sum m_efm_norm_story if age == 16 & scenario == 1 & amt == 5
	sum m_efm_norm_story if age == 16 & scenario == 1 & amt == 9
	sum m_efm_norm_story if age == 16 & scenario == 1 & amt == 10
	sum m_efm_norm_story if age == 16 & scenario == 1 

	sum m_efm_norm_story if age == 18 & scenario == 1 & amt == 5
	sum m_efm_norm_story if age == 18 & scenario == 1 & amt == 9
	sum m_efm_norm_story if age == 18 & scenario == 1 & amt == 10
	sum m_efm_norm_story if age == 18 & scenario == 1 
	
	sum m_efm_norm_story if age == 15 
	sum m_efm_norm_story if age == 16 
	sum m_efm_norm_story if age == 18 
	
	sum m_efm_norm_story if amt == 5 & scenario == 0 
	sum m_efm_norm_story if amt == 9 & scenario == 0
	sum m_efm_norm_story if amt == 10 & scenario == 0
	sum m_efm_norm_story if scenario == 0


	sum m_efm_norm_story if amt == 5 & scenario == 1 
	sum m_efm_norm_story if amt == 9 & scenario == 1
	sum m_efm_norm_story if amt == 10 & scenario == 1
	sum m_efm_norm_story if scenario == 1	
	
	sum m_efm_norm_story
	
/* Table 3 _____________________________________________________________________

Sample Characteristics and Covariate Balance
	
Note that RI pvalues are generated in the balance test table in Appendix

*/

	use "${cps_efm_path}/cps_efm_analysis.dta", clear

	sum resp_age if treat == 1
	sum resp_age if treat == 0
	
	sum resp_female if treat == 1
	sum resp_female if treat == 0
	
	sum resp_muslim if treat == 1
	sum resp_muslim if treat == 0
	
	sum b_resp_standard7 if treat == 1
	sum b_resp_standard7 if treat == 0
	
	sum b_resp_married if treat == 1
	sum b_resp_married if treat == 0 
	
	sum b_asset_cell if treat == 1
	sum b_asset_cell if treat == 0 
	
	sum b_asset_radio_num if treat == 1
	sum b_asset_radio_num if treat == 0 
	
	sum b_ge_index if treat == 1
	sum b_ge_index if treat == 0 
	
		
	
/* Table 4 _____________________________________________________________________

Attitudes toward Early Forced Marriage, 2-3 Weeks After Exposure
	
	m_fm_reject
	m_fm_reject_18
	m_fm_reject_story
	m_fm_reject_story_money
	m_fm_reject_story_daught	
*/

		use "${cps_efm_path}/cps_efm_analysis.dta", clear
		merge 1:1 id_resp_uid using "${cps_efm_path}/cps_efm_ri.dta"
		keep if complier == 1 

		** Reject FM
			** Column 1
			global dv m_fm_reject
			global test onesided 
			
			sum $dv if treat == 0 // control mean
			preserve
				qui collapse (mean) $dv treat, by(id_village_n) // control village sd
				sum $dv if treat == 0
			restore
			
		xi: reg $dv treat ${cov_always}, cluster(id_village_n)					// This is the core regression
			matrix table = r(table)
			global coef = table[1,1]    	//beta
			do "${cps_efm_path}/cps_efm_helper_pval_ri.do"
			di "${ripval}"
			
		** Column 2
		set seed 1956
		qui lasso linear $dv ${cov_lasso}										// This is the LASSO regression
			global lasso_ctls = e(allvars_sel)										
			global lasso_ctls_num = e(k_nonzero_sel)

		if ${lasso_ctls_num} != 0 {												// If lassovars selected	
			regress $dv treat ${cov_always} ${lasso_ctls}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}
			
		if ${lasso_ctls_num} == 0 {												// If no lassovars selected
			regress $dv treat ${cov_always}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}	
			
		global lasso_coef = lasso_table[1,1]    	//beta
		do "${cps_efm_path}/cps_efm_helper_pval_ri_lasso.do"
		di "${lasso_ripval2}"
		
		
	** Reject FM (18+)
		** Column 3
		global dv m_fm_reject_18
		global test onesided 
		
		sum $dv if treat == 0 // control mean
			preserve
				qui collapse (mean) $dv treat, by(id_village_n) // control village sd
				sum $dv if treat == 0
			restore
		
		xi: reg $dv treat ${cov_always}, cluster(id_village_n)					// This is the core regression
			matrix table = r(table)
			global coef = table[1,1]    	//beta
			do "${cps_efm_path}/cps_efm_helper_pval_ri.do"
			di "${ripval}"
			
		** Column 4
		set seed 1956
		qui lasso linear $dv ${cov_lasso}										// This is the LASSO regression
			global lasso_ctls = e(allvars_sel)										
			global lasso_ctls_num = e(k_nonzero_sel)

		if ${lasso_ctls_num} != 0 {												// If lassovars selected	
			regress $dv treat ${cov_always} ${lasso_ctls}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}
			
		if ${lasso_ctls_num} == 0 {												// If no lassovars selected
			regress $dv treat ${cov_always}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}	
			
		global lasso_coef = lasso_table[1,1]    	//beta
		do "${cps_efm_path}/cps_efm_helper_pval_ri_lasso.do"
		di "${lasso_ripval2}"
		
		
	** Reject Early Forced Marriage - Money
		** Column 5
		global dv m_em_reject_story_money
		global test onesided 
		
		sum $dv if treat == 0 // control mean
			preserve
				qui collapse (mean) $dv treat, by(id_village_n) // control village sd
				sum $dv if treat == 0
			restore
			
		xi: reg $dv treat ${cov_always}, cluster(id_village_n)					// This is the core regression
			matrix table = r(table)
			global coef = table[1,1]    	//beta
			do "${cps_efm_path}/cps_efm_helper_pval_ri.do"
			di "${ripval}"
			
		** Column 6
		set seed 1956
		qui lasso linear $dv ${cov_lasso}										// This is the LASSO regression
			global lasso_ctls = e(allvars_sel)										
			global lasso_ctls_num = e(k_nonzero_sel)

		if ${lasso_ctls_num} != 0 {												// If lassovars selected	
			regress $dv treat ${cov_always} ${lasso_ctls}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}
			
		if ${lasso_ctls_num} == 0 {												// If no lassovars selected
			regress $dv treat ${cov_always}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}	
			
		global lasso_coef = lasso_table[1,1]    	//beta
		do "${cps_efm_path}/cps_efm_helper_pval_ri_lasso.do"
		di "${lasso_ripval2}"
		
		
	** Reject Early Forced Marriage - Misbehaving
		** Column 7
		global dv m_em_reject_story_daught
		global test onesided 
		
		sum $dv if treat == 0 // control mean
			preserve
				qui collapse (mean) $dv treat, by(id_village_n) // control village sd
				sum $dv if treat == 0
			restore
			
		xi: reg $dv treat ${cov_always}, cluster(id_village_n)					// This is the core regression
			matrix table = r(table)
			global coef = table[1,1]    	//beta
			do "${cps_efm_path}/cps_efm_helper_pval_ri.do"
			di "${ripval}"
			
		** Column 8
		set seed 1956
		qui lasso linear $dv ${cov_lasso}										// This is the LASSO regression
			global lasso_ctls = e(allvars_sel)										
			global lasso_ctls_num = e(k_nonzero_sel)

		if ${lasso_ctls_num} != 0 {												// If lassovars selected	
			regress $dv treat ${cov_always} ${lasso_ctls}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}
			
		if ${lasso_ctls_num} == 0 {												// If no lassovars selected
			regress $dv treat ${cov_always}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}	
			
		global lasso_coef = lasso_table[1,1]    	//beta
		do "${cps_efm_path}/cps_efm_helper_pval_ri_lasso.do"
		di "${lasso_ripval2}"
		

/* Table 5 _____________________________________________________________________

Perceived Community Norms about Early Forced Marriage, 2-3Weeks After
Exposure
	
	m_fm_reject_norm
	m_em_reject_norm_under18

*/

	use "${cps_efm_path}/cps_efm_analysis.dta", clear
		merge 1:1 id_resp_uid using "${cps_efm_path}/cps_efm_ri.dta"
	keep if complier == 1 

	** Reject FM
		** Column 1
		global dv m_fm_reject_norm
		global test onesided 
		
		sum $dv if treat == 0 // control mean
			preserve
				qui collapse (mean) $dv treat, by(id_village_n) // control village sd
				sum $dv if treat == 0
			restore
			
		xi: reg $dv treat ${cov_always}, cluster(id_village_n)					// This is the core regression
			matrix table = r(table)
			global coef = table[1,1]    	//beta
			do "${cps_efm_path}/cps_efm_helper_pval_ri.do"
			di "${ripval}"
			
		** Column 2
		set seed 1956
		qui lasso linear $dv ${cov_lasso}										// This is the LASSO regression
			global lasso_ctls = e(allvars_sel)										
			global lasso_ctls_num = e(k_nonzero_sel)

		if ${lasso_ctls_num} != 0 {												// If lassovars selected	
			regress $dv treat ${cov_always} ${lasso_ctls}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}
			
		if ${lasso_ctls_num} == 0 {												// If no lassovars selected
			regress $dv treat ${cov_always}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}	
			
		global lasso_coef = lasso_table[1,1]    	//beta
		do "${cps_efm_path}/cps_efm_helper_pval_ri_lasso.do"
		di "${lasso_ripval2}"
		
		
	** Reject FM (18+)
		** Column 3
		global dv m_em_reject_norm_under18
		global test onesided 
		
		sum $dv if treat == 0 // control mean
			preserve
				qui collapse (mean) $dv treat, by(id_village_n) // control village sd
				sum $dv if treat == 0
			restore
			
		xi: reg $dv treat ${cov_always}, cluster(id_village_n)					// This is the core regression
			matrix table = r(table)
			global coef = table[1,1]    	//beta
			do "${cps_efm_path}/cps_efm_helper_pval_ri.do"
			di "${ripval}"
			
		** Column 4
		set seed 1956
		qui lasso linear $dv ${cov_lasso}										// This is the LASSO regression
			global lasso_ctls = e(allvars_sel)										
			global lasso_ctls_num = e(k_nonzero_sel)

		if ${lasso_ctls_num} != 0 {												// If lassovars selected	
			regress $dv treat ${cov_always} ${lasso_ctls}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}
			
		if ${lasso_ctls_num} == 0 {												// If no lassovars selected
			regress $dv treat ${cov_always}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}	
			
		global lasso_coef = lasso_table[1,1]    	//beta
		do "${cps_efm_path}/cps_efm_helper_pval_ri_lasso.do"
		di "${lasso_ripval2}"
		
		
/* Table 6 _____________________________________________________________________

Views about Reporting an Underage Marriage to Authorities, 2-3Weeks After
Exposure
	
	m_em_report 
	m_em_report_norm	
	
*/

	use "${cps_efm_path}/cps_efm_analysis.dta", clear
		merge 1:1 id_resp_uid using "${cps_efm_path}/cps_efm_ri.dta"
	keep if complier == 1 

	** Would Report EFM
		** Column 1
		global dv m_em_report 
		global test onesided 
		
		sum $dv if treat == 0 // control mean
			preserve
				qui collapse (mean) $dv treat, by(id_village_n) // control village sd
				sum $dv if treat == 0
			restore
			
		xi: reg $dv treat ${cov_always}, cluster(id_village_n)					// This is the core regression
			matrix table = r(table)
			global coef = table[1,1]    	//beta
			do "${cps_efm_path}/cps_efm_helper_pval_ri.do"
			di "${ripval}"
			
		** Column 2
		set seed 1956
		qui lasso linear $dv ${cov_lasso}										// This is the LASSO regression
			global lasso_ctls = e(allvars_sel)										
			global lasso_ctls_num = e(k_nonzero_sel)

		if ${lasso_ctls_num} != 0 {												// If lassovars selected	
			regress $dv treat ${cov_always} ${lasso_ctls}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}
			
		if ${lasso_ctls_num} == 0 {												// If no lassovars selected
			regress $dv treat ${cov_always}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}	
			
		global lasso_coef = lasso_table[1,1]    	//beta
		do "${cps_efm_path}/cps_efm_helper_pval_ri_lasso.do"
		di "${lasso_ripval2}"
		
		
	** Community Would Report EFM
		** Column 3
		global dv m_em_report_norm
		global test onesided 
		
		sum $dv if treat == 0 // control mean
			preserve
				qui collapse (mean) $dv treat, by(id_village_n) // control village sd
				sum $dv if treat == 0
			restore
			
		xi: reg $dv treat ${cov_always}, cluster(id_village_n)					// This is the core regression
			matrix table = r(table)
			global coef = table[1,1]    	//beta
			do "${cps_efm_path}/cps_efm_helper_pval_ri.do"
			di "${ripval}"
			
		** Column 4
		set seed 1956
		qui lasso linear $dv ${cov_lasso}										// This is the LASSO regression
			global lasso_ctls = e(allvars_sel)										
			global lasso_ctls_num = e(k_nonzero_sel)

		if ${lasso_ctls_num} != 0 {												// If lassovars selected	
			regress $dv treat ${cov_always} ${lasso_ctls}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}
			
		if ${lasso_ctls_num} == 0 {												// If no lassovars selected
			regress $dv treat ${cov_always}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}	
			
		global lasso_coef = lasso_table[1,1]    	//beta
		do "${cps_efm_path}/cps_efm_helper_pval_ri_lasso.do"
		di "${lasso_ripval2}"
			
		
	
/* Table 7 _____________________________________________________________________

Importance of Reducing Forced Marriage as a Political Priority, 2-3Weeks
After Exposure

	m_ptixpref_efm_first
	m_em_elect
	
*/

	use "${cps_efm_path}/cps_efm_analysis.dta", clear
		merge 1:1 id_resp_uid using "${cps_efm_path}/cps_efm_ri.dta"
	keep if complier == 1 

	** Top Priority
		** Column 1
		global dv m_ptixpref_efm_first
		global test onesided 
		
		sum $dv if treat == 0 // control mean
			preserve
				qui collapse (mean) $dv treat, by(id_village_n) // control village sd
				sum $dv if treat == 0
			restore
			
		xi: reg $dv treat ${cov_always}, cluster(id_village_n)					// This is the core regression
			matrix table = r(table)
			global coef = table[1,1]    	//beta
			do "${cps_efm_path}/cps_efm_helper_pval_ri.do"
			di "${ripval}"
			
		** Column 2
		set seed 1956
		qui lasso linear $dv ${cov_lasso}										// This is the LASSO regression
			global lasso_ctls = e(allvars_sel)										
			global lasso_ctls_num = e(k_nonzero_sel)

		if ${lasso_ctls_num} != 0 {												// If lassovars selected	
			regress $dv treat ${cov_always} ${lasso_ctls}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}
			
		if ${lasso_ctls_num} == 0 {												// If no lassovars selected
			regress $dv treat ${cov_always}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}	
			
		global lasso_coef = lasso_table[1,1]    	//beta
		do "${cps_efm_path}/cps_efm_helper_pval_ri_lasso.do"
		di "${lasso_ripval2}"
		
		
	** Vote EFM Platform
		** Column 3
		global dv m_em_elect
		global test onesided 
		
		sum $dv if treat == 0 // control mean
			preserve
				qui collapse (mean) $dv treat, by(id_village_n) // control village sd
				sum $dv if treat == 0
			restore
			
		xi: reg $dv treat ${cov_always}, cluster(id_village_n)					// This is the core regression
			matrix table = r(table)
			global coef = table[1,1]    	//beta
			do "${cps_efm_path}/cps_efm_helper_pval_ri.do"
			di "${ripval}"
			
		** Column 4
		set seed 1956
		qui lasso linear $dv ${cov_lasso}										// This is the LASSO regression
			global lasso_ctls = e(allvars_sel)										
			global lasso_ctls_num = e(k_nonzero_sel)

		if ${lasso_ctls_num} != 0 {												// If lassovars selected	
			regress $dv treat ${cov_always} ${lasso_ctls}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}
			
		if ${lasso_ctls_num} == 0 {												// If no lassovars selected
			regress $dv treat ${cov_always}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}	
			
		global lasso_coef = lasso_table[1,1]    	//beta
		do "${cps_efm_path}/cps_efm_helper_pval_ri_lasso.do"
		di "${lasso_ripval2}"
		
		
		
		
/* Table 8 _____________________________________________________________________

Views about Gender Equality and Intimate Partner Violence, 2-3Weeks After
Exposure

	m_ge_index
	m_ipv_rej_disobey_long
	m_ipv_norm_rej
	m_ipv_report
	
*/

	use "${cps_efm_path}/cps_efm_analysis.dta", clear
		merge 1:1 id_resp_uid using "${cps_efm_path}/cps_efm_ri.dta"
	keep if complier == 1 

	** Gender Equality Index
		** Column 1
		global dv m_ge_index
		global test onesided 
		
		sum $dv if treat == 0 // control mean
			preserve
				qui collapse (mean) $dv treat, by(id_village_n) // control village sd
				sum $dv if treat == 0
			restore
			
		xi: reg $dv treat ${cov_always}, cluster(id_village_n)					// This is the core regression
			matrix table = r(table)
			global coef = table[1,1]    	//beta
			do "${cps_efm_path}/cps_efm_helper_pval_ri.do"
			di "${ripval}"
			
		** Column 2
		set seed 1956
		qui lasso linear $dv ${cov_lasso}										// This is the LASSO regression
			global lasso_ctls = e(allvars_sel)										
			global lasso_ctls_num = e(k_nonzero_sel)

		if ${lasso_ctls_num} != 0 {												// If lassovars selected	
			regress $dv treat ${cov_always} ${lasso_ctls}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}
			
		if ${lasso_ctls_num} == 0 {												// If no lassovars selected
			regress $dv treat ${cov_always}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}	
			
		global lasso_coef = lasso_table[1,1]    	//beta
		do "${cps_efm_path}/cps_efm_helper_pval_ri_lasso.do"
		di "${lasso_ripval2}"
		
		
	** IPV - If disobeys (branched)
		** Column 3
		global dv m_ipv_rej_disobey_long
		global test onesided 
		
		sum $dv if treat == 0 // control mean
			preserve
				qui collapse (mean) $dv treat, by(id_village_n) // control village sd
				sum $dv if treat == 0
			restore
			
		xi: reg $dv treat ${cov_always}, cluster(id_village_n)					// This is the core regression
			matrix table = r(table)
			global coef = table[1,1]    	//beta
			do "${cps_efm_path}/cps_efm_helper_pval_ri.do"
			di "${ripval}"
			
		** Column 4
		set seed 1956
		qui lasso linear $dv ${cov_lasso}										// This is the LASSO regression
			global lasso_ctls = e(allvars_sel)										
			global lasso_ctls_num = e(k_nonzero_sel)

		if ${lasso_ctls_num} != 0 {												// If lassovars selected	
			regress $dv treat ${cov_always} ${lasso_ctls}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}
			
		if ${lasso_ctls_num} == 0 {												// If no lassovars selected
			regress $dv treat ${cov_always}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}	
			
		global lasso_coef = lasso_table[1,1]    	//beta
		do "${cps_efm_path}/cps_efm_helper_pval_ri_lasso.do"
		di "${lasso_ripval2}"
		
	** IPV - Norm
		** Column 5
		global dv m_ipv_norm_rej
		global test onesided 
		
		sum $dv if treat == 0 // control mean
			preserve
				qui collapse (mean) $dv treat, by(id_village_n) // control village sd
				sum $dv if treat == 0
			restore
			
		xi: reg $dv treat ${cov_always}, cluster(id_village_n)					// This is the core regression
			matrix table = r(table)
			global coef = table[1,1]    	//beta
			do "${cps_efm_path}/cps_efm_helper_pval_ri.do"
			di "${ripval}"

			
		** Column 6
		set seed 1956
		qui lasso linear $dv ${cov_lasso}										// This is the LASSO regression
			global lasso_ctls = e(allvars_sel)										
			global lasso_ctls_num = e(k_nonzero_sel)

		if ${lasso_ctls_num} != 0 {												// If lassovars selected	
			regress $dv treat ${cov_always} ${lasso_ctls}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}
			
		if ${lasso_ctls_num} == 0 {												// If no lassovars selected
			regress $dv treat ${cov_always}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}	
			
		global lasso_coef = lasso_table[1,1]    	//beta
		do "${cps_efm_path}/cps_efm_helper_pval_ri_lasso.do"
		di "${lasso_ripval2}"	
		
		
		
	** IPV - Report
		** Column 7
		global dv m_ipv_report 
		global test onesided 
		
		sum $dv if treat == 0 // control mean
			preserve
				qui collapse (mean) $dv treat, by(id_village_n) // control village sd
				sum $dv if treat == 0
			restore
			
		xi: reg $dv treat ${cov_always}, cluster(id_village_n)					// This is the core regression
			matrix table = r(table)
			global coef = table[1,1]    	//beta
			do "${cps_efm_path}/cps_efm_helper_pval_ri.do"
			di "${ripval}"
			
		** Column 8
		set seed 1956
		qui lasso linear $dv ${cov_lasso}										// This is the LASSO regression
			global lasso_ctls = e(allvars_sel)										
			global lasso_ctls_num = e(k_nonzero_sel)

		if ${lasso_ctls_num} != 0 {												// If lassovars selected	
			regress $dv treat ${cov_always} ${lasso_ctls}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}
			
		if ${lasso_ctls_num} == 0 {												// If no lassovars selected
			regress $dv treat ${cov_always}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}	
			
		global lasso_coef = lasso_table[1,1]    	//beta
		do "${cps_efm_path}/cps_efm_helper_pval_ri_lasso.do"
		di "${lasso_ripval2}"	
		
		
		
		
/* Table 9 _____________________________________________________________________

Attitudes toward Early Forced Marriage, 15 Months After Exposure

	fm_reject
	fm_reject_long 									
	p_fm_partner_reject
	
	em_reject
	em_reject_money_dum
	em_reject_pregnant_dum 
	
*/

	use "${cps_efm_path}/cps_efm_analysis.dta", clear
		merge 1:1 id_resp_uid using "${cps_efm_path}/cps_efm_ri.dta"
	keep if complier == 1 

	** Reject Forced Marriage - Binary
		** Column 1
		global dv fm_reject
		global test onesided 
		
		sum $dv if treat == 0 // control mean
			preserve
				qui collapse (mean) $dv$ treat, by(id_village_n) // control village sd
				sum $dv if treat == 0
			restore
			
		xi: reg $dv treat ${cov_always}, cluster(id_village_n)					// This is the core regression
			matrix table = r(table)
			global coef = table[1,1]    	//beta
			do "${cps_efm_path}/cps_efm_helper_pval_ri.do"
			di "${ripval}"
			
		** Column 2
		set seed 1956
		qui lasso linear $dv ${cov_lasso}										// This is the LASSO regression
			global lasso_ctls = e(allvars_sel)										
			global lasso_ctls_num = e(k_nonzero_sel)

		if ${lasso_ctls_num} != 0 {												// If lassovars selected	
			regress $dv treat ${cov_always} ${lasso_ctls}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}
			
		if ${lasso_ctls_num} == 0 {												// If no lassovars selected
			regress $dv treat ${cov_always}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}	
			
		global lasso_coef = lasso_table[1,1]    	//beta
		do "${cps_efm_path}/cps_efm_helper_pval_ri_lasso.do"
		di "${lasso_ripval2}"
		
		
	** Reject Forced Marriage - Branched
		** Column 3
		global dv fm_reject_long 
		global test onesided 
		
		sum $dv if treat == 0 // control mean
			preserve
				qui collapse (mean) $dv treat, by(id_village_n) // control village sd
				sum $dv if treat == 0
			restore
			
		xi: reg $dv treat ${cov_always}, cluster(id_village_n)					// This is the core regression
			matrix table = r(table)
			global coef = table[1,1]    	//beta
			do "${cps_efm_path}/cps_efm_helper_pval_ri.do"
			di "${ripval}"
			
		** Column 4
		set seed 1956
		qui lasso linear $dv ${cov_lasso}										// This is the LASSO regression
			global lasso_ctls = e(allvars_sel)										
			global lasso_ctls_num = e(k_nonzero_sel)

		if ${lasso_ctls_num} != 0 {												// If lassovars selected	
			regress $dv treat ${cov_always} ${lasso_ctls}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}
			
		if ${lasso_ctls_num} == 0 {												// If no lassovars selected
			regress $dv treat ${cov_always}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}	
			
		global lasso_coef = lasso_table[1,1]    	//beta
		do "${cps_efm_path}/cps_efm_helper_pval_ri_lasso.do"
		di "${lasso_ripval2}"
		
	** Reject Forced Marriage - Partner
		** Column 5
		global dv p_fm_partner_reject
		global test onesided 
		
		sum $dv if treat == 0 // control mean
			preserve
				qui collapse (mean) $dv treat, by(id_village_n) // control village sd
				sum $dv if treat == 0
			restore
			
		xi: reg $dv treat ${cov_always}, cluster(id_village_n)					// This is the core regression
			matrix table = r(table)
			global coef = table[1,1]    	//beta
			do "${cps_efm_path}/cps_efm_helper_pval_ri.do"
			di "${ripval}"
			
		** Column 6
		set seed 1956
		qui lasso linear $dv ${cov_lasso}										// This is the LASSO regression
			global lasso_ctls = e(allvars_sel)										
			global lasso_ctls_num = e(k_nonzero_sel)

		if ${lasso_ctls_num} != 0 {												// If lassovars selected	
			regress $dv treat ${cov_always} ${lasso_ctls}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}
			
		if ${lasso_ctls_num} == 0 {												// If no lassovars selected
			regress $dv treat ${cov_always}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}	
			
		global lasso_coef = lasso_table[1,1]    	//beta
		do "${cps_efm_path}/cps_efm_helper_pval_ri_lasso.do"
		di "${lasso_ripval2}"	
		
		
		
	** Reject Early Forced Marriage - General
		** Column 7
		global dv em_reject
		global test onesided 
		
		sum $dv if treat == 0 // control mean
			preserve
				qui collapse (mean) $dv treat, by(id_village_n) // control village sd
				sum $dv if treat == 0
			restore
			
		xi: reg $dv treat ${cov_always}, cluster(id_village_n)					// This is the core regression
			matrix table = r(table)
			global coef = table[1,1]    	//beta
			do "${cps_efm_path}/cps_efm_helper_pval_ri.do"
			di "${ripval}"
			
		** Column 8
		set seed 1956
		qui lasso linear $dv ${cov_lasso}										// This is the LASSO regression
			global lasso_ctls = e(allvars_sel)										
			global lasso_ctls_num = e(k_nonzero_sel)

		if ${lasso_ctls_num} != 0 {												// If lassovars selected	
			regress $dv treat ${cov_always} ${lasso_ctls}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}
			
		if ${lasso_ctls_num} == 0 {												// If no lassovars selected
			regress $dv treat ${cov_always}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}	
			
		global lasso_coef = lasso_table[1,1]    	//beta
		do "${cps_efm_path}/cps_efm_helper_pval_ri_lasso.do"
		di "${lasso_ripval2}"	
		
		
	** Reject Early Forced Marriage - Money
		** Column 9
		global dv em_reject_money_dum
		global test onesided 
		
		sum $dv if treat == 0 // control mean
			preserve
				qui collapse (mean) $dv treat, by(id_village_n) // control village sd
				sum $dv if treat == 0
			restore
			
		xi: reg $dv treat ${cov_always}, cluster(id_village_n)					// This is the core regression
			matrix table = r(table)
			global coef = table[1,1]    	//beta
			do "${cps_efm_path}/cps_efm_helper_pval_ri.do"
			di "${ripval}"
			
		** Column 10
		set seed 1956
		qui lasso linear $dv ${cov_lasso}										// This is the LASSO regression
			global lasso_ctls = e(allvars_sel)										
			global lasso_ctls_num = e(k_nonzero_sel)

		if ${lasso_ctls_num} != 0 {												// If lassovars selected	
			regress $dv treat ${cov_always} ${lasso_ctls}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}
			
		if ${lasso_ctls_num} == 0 {												// If no lassovars selected
			regress $dv treat ${cov_always}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}	
			
		global lasso_coef = lasso_table[1,1]    	//beta
		do "${cps_efm_path}/cps_efm_helper_pval_ri_lasso.do"
		di "${lasso_ripval2}"
		
		
	** Reject Early Forced Marriage - Money
		** Column 11
		global dv em_reject_pregnant_dum
		global test onesided 
		
		sum $dv if treat == 0 // control mean
			preserve
				qui collapse (mean) $dv treat, by(id_village_n) // control village sd
				sum $dv if treat == 0
			restore
			
		xi: reg $dv treat ${cov_always}, cluster(id_village_n)					// This is the core regression
			matrix table = r(table)
			global coef = table[1,1]    	//beta
			do "${cps_efm_path}/cps_efm_helper_pval_ri.do"
			di "${ripval}"
			
		** Column 12
		set seed 1956
		qui lasso linear $dv ${cov_lasso}										// This is the LASSO regression
			global lasso_ctls = e(allvars_sel)										
			global lasso_ctls_num = e(k_nonzero_sel)

		if ${lasso_ctls_num} != 0 {												// If lassovars selected	
			regress $dv treat ${cov_always} ${lasso_ctls}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}
			
		if ${lasso_ctls_num} == 0 {												// If no lassovars selected
			regress $dv treat ${cov_always}, cluster(id_village_n)
				matrix lasso_table = r(table)
			}	
			
		global lasso_coef = lasso_table[1,1]    	//beta
		do "${cps_efm_path}/cps_efm_helper_pval_ri_lasso.do"
		di "${lasso_ripval2}"
		
		
		
		log close
